package shun.demo.audio;

import android.app.Activity;
import android.media.AudioManager;
import android.os.Bundle;
import android.view.View;
import shun.demo.R;

/**
 * Created by chen on 3/4/14.
 */
public class AudioActivity extends Activity implements View.OnClickListener {
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.audio);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.music:
                setVolumeControlStream(AudioManager.STREAM_MUSIC);
                break;

            case R.id.ring:
                setVolumeControlStream(AudioManager.STREAM_RING);
                break;

            case R.id.alarm:
                setVolumeControlStream(AudioManager.STREAM_ALARM);
                break;
            default:
                break;
        }
    }
}